<template>
  <InfoHR title='请求参数' />
  <a-table
    :columns='requestParameterColumns'
    :data='requestParameter'
    :pagination='false'
    column-resizable
    :bordered='{cell:true}'
  />
  <InfoHR title='返回结果参数' />
  <a-table
    :columns='responseParameterColumns'
    :data='responseParameter'
    :pagination='false'
    column-resizable
    :bordered='{cell:true}'
  />
</template>

<script setup lang='ts'>
import InfoHR from "@/views/urlshorten/useApi/components/infoHR.vue";

const requestParameterColumns = [
  {
    title: "参数名",
    dataIndex: "name",
    width: 150,
    minWidth: 100
  },
  {
    title: "类型",
    dataIndex: "salary",
    width: 120,
    minWidth: 80
  },
  {
    title: "是否必须",
    dataIndex: "address",
    width: 300
  },
  {
    title: "描述",
    dataIndex: "email"
  },
  {
    title: "示例值",
    dataIndex: "example"
  }
];
const requestParameter = [
  {
    key: "1",
    name: "access key",
    salary: "String",
    address: "是",
    email: "进入系统的令牌",
    example: "进入系统的令牌",
  },
  {
    key: "2",
    name: "originUrl",
    salary: "String",
    address: "是",
    email: "原始链接",
    example: "https://baiud.com",
  },
  {
    key: "3",
    name: "gid",
    salary: "String",
    address: "是",
    email: "分组标识",
  },
  {
    key: "4",
    name: "validDateType",
    salary: "Integer",
    address: "否",
    email: "有效期类型 0：永久有效 1：自定义 默认0",
  },
  {
    key: "5",
    name: "validDate",
    salary: "String",
    address: "否",
    email: "有效期",
    example: "格式 yyyy-MM-dd HH:mm:ss",
  },
];

const responseParameterColumns = [
  {
    title: "参数名",
    dataIndex: "name",
    width: 150,
    minWidth: 100
  },
  {
    title: "类型",
    dataIndex: "type",
    width: 120,
    minWidth: 80
  },
  {
    title: "描述",
    dataIndex: "description"
  },
  {
    title: "实例值",
    dataIndex: "example"
  }
];
const responseParameter = [
  {
    name: "code",
    type: "String",
    description: "状态码",
    example: "200为成功"
  },
  {
    name: "url",
    type: "String",
    description: "生成的短网址，如果生成失败，则返回原链接",
    example: "http//suolink.cn/abcdefg"
  },
  {
    name: "errMsg",
    type: "String",
    description: "异常描述",
    example: "无异常该字段为空"
  }
];
</script>

<style scoped lang='less'>

</style>